|
|
|
|
|
|
|
Practical Guidelines for Implementing the Business Rules Subsystem |
|
|
|
|
|
|
|
|
Most of the classes described here have been implemented. For Day 18's lesson, you will implement the ErrorHandler class for the example. The Branch Manager of the Second Bank of Carrollton has already provided the business policy management information you need, represented by the use cases and sequence diagrams. |
|
|
|
|
|
|
|
|
Listing 15.1 contains subsystem code for the Samsona Bank Teller System example. The code for Listing 15.1 can be found on the CD-ROM in the \Day15 folder. |
|
|
|
|
|
|
|
|
LISTING 15.1. CODE THAT SHOWS THE ENFORCEMENT OF THE RULE FOR CASH DEPOSITS. |
|
|
|
 |
|
|
|
|
1: 'Global declarations in modErrorHandling
2: Global theErrorHandler As New ErrorHandler
3: Global theCashDepositRecord As CashDepositRecord
4: Public Enum eBusinessRules
5: CheckDepositAmount
6: End Enum
7:
8: 'The DepositFunds class
9: Private theForm As frmDeposit
10: Private theDeposit As Deposit
11: Private Enum eDeposit
12: AccountID
13: Amount
14: End Enum
15: Private Sub Class_Terminate()
16: #If DebugMode Then
17: 'the class is being destroyed
18: Debug.Print ' & TypeName(Me) & ' instance & CStr(mlClassDebugID) & is terminating
19: #End If
20: Set theForm = Nothing
21: Set theDeposit = Nothing
22: End Sub
23: '##ModelId=34FDB8C302E4
24: Private Sub Class_Initialize()
25: #If DebugMode Then
26: 'get the next available class ID, and print out
27: 'that the class was created successfully
28: mlClassDebugID = GetNextClassDebugID()
29: Debug.Print ' & TypeName(Me) & ' instance & CStr(mlClassDebugID) & created
30: #End If
31: Set theForm = frmDeposit
|
|
|
|
|
|